// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless;

/// <summary>
/// <para>Contains statistics about the number of nodes selected by the request.</para>
/// </summary>
public sealed partial class NodeStatistics
{
	/// <summary>
	/// <para>Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("failed")]
	public int Failed { get; init; }
	[JsonInclude, JsonPropertyName("failures")]
	public IReadOnlyCollection<Elastic.Clients.Elasticsearch.Serverless.ErrorCause>? Failures { get; init; }

	/// <summary>
	/// <para>Number of nodes that responded successfully to the request.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("successful")]
	public int Successful { get; init; }

	/// <summary>
	/// <para>Total number of nodes selected by the request.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("total")]
	public int Total { get; init; }
}